<script setup>
import { onMounted,getCurrentInstance } from "vue";
import { useRouter } from "vue-router";

const { proxy } = getCurrentInstance();
const router = useRouter();

onMounted(() => {
  console.log("App.vue");
  const allRoutes = router.getRoutes();
  console.log("所有路由:", allRoutes);
});

function showDialog() {
  const vnode = proxy.$dialog.show({
    message: "这是通过 proxy.$dialog 调用的！",
  });
  console.log("生成的 VNode:", vnode);
}
</script>

<template>
  <div class="app-container">
    <router-view />
  </div>
</template>

<style scoped>
.app-container {
  background-color: #f0f0f0;
  height: 100vh; /*100vh 兼容性差 */
  height: 100svh; /*100svh 最小视口高度 */
  height: 100lvh; /*100lvh 最大视口高度 */
  height: 100dvh; /*100dvh 动态视口高度 */
}
</style>
